﻿package hapi.web;

class PrettyPathMatcherFactory implements PathMatcherFactory {
	
	public function new() {}
	
	public function create(uri:String):PathMatcher {
		
		if (uri.indexOf("/") < 0 ) {
			//just part of path
			if (uri.charAt(0) == ":") {
				return new ParamPathMatcher(uri.substr(1));
			}else {
				return new StaticPathMatcher(uri);
			}
		}else {
			//full path
			return new PathMatcherComposite(uri, this);
		}
	}
}